]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
overviewControls: Don't allow appearing controls to "pop in"
authorJasper St. Pierre <jstpierre@mecheye.net>
Thu, 19 Sep 2013 00:17:32 +0000 (20:17 -0400)
committerJasper St. Pierre <jstpierre@mecheye.net>
Thu, 26 Sep 2013 17:39:20 +0000 (13:39 -0400)
When coming back from search or apps, the workspace thumbnails and dash
don't slide in but "pop in". This is because of bad timing: when slideIn
is called, we immediately start the translation animation, and it
completes before by the time we fade the new page in.

Fix this by calling slideIn and slideOut at two different times: we now
slide out when the old page with our controls is fading out, and slide in
when the new page with our controls is fading in.

https://bugzilla.gnome.org/show_bug.cgi?id=708340

js/ui/overviewControls.js

index c16c4ac54c37ef82789883d8e9489daa4fcf5bf1..f5314762eace27b9f2a5c3c1b69bc8e9a19ed3c1 100644 (file)
@@ -208,23 +208,12 @@ const SlidingControl = new Lang.Class({
     slideIn: function() {
         this.visible = true;
         this._updateTranslation();
-        // we will update slideX and the translation from pageEmpty
     },
 
     slideOut: function() {
         this.visible = false;
         this._updateTranslation();
-        // we will update slideX from pageEmpty
     },
-
-    pageEmpty: function() {
-        // When pageEmpty is received, there's no visible view in the
-        // selector; this means we can now safely set the full slide for
-        // the next page, since slideIn or slideOut might have been called,
-        // changing the visiblity
-        this.layout.slideX = this.getSlide();
-        this._updateTranslation();
-    }
 });
 
 const ThumbnailsSlider = new Lang.Class({
@@ -600,18 +589,14 @@ const ControlsManager = new Lang.Class({
             return;
 
         let activePage = this.viewSelector.getActivePage();
+
         let dashVisible = (activePage == ViewSelector.ViewPage.WINDOWS ||
                            activePage == ViewSelector.ViewPage.APPS);
-        let thumbnailsVisible = (activePage == ViewSelector.ViewPage.WINDOWS);
-
-        if (dashVisible)
-            this._dashSlider.slideIn();
-        else
+        if (!dashVisible)
             this._dashSlider.slideOut();
 
-        if (thumbnailsVisible)
-            this._thumbnailsSlider.slideIn();
-        else
+        let thumbnailsVisible = (activePage == ViewSelector.ViewPage.WINDOWS);
+        if (!thumbnailsVisible)
             this._thumbnailsSlider.slideOut();
     },
 
@@ -624,8 +609,16 @@ const ControlsManager = new Lang.Class({
     },
 
     _onPageEmpty: function() {
-        this._dashSlider.pageEmpty();
-        this._thumbnailsSlider.pageEmpty();
+        let activePage = this.viewSelector.getActivePage();
+
+        let dashVisible = (activePage == ViewSelector.ViewPage.WINDOWS ||
+                           activePage == ViewSelector.ViewPage.APPS);
+        if (dashVisible)
+            this._dashSlider.slideIn();
+
+        let thumbnailsVisible = (activePage == ViewSelector.ViewPage.WINDOWS);
+        if (thumbnailsVisible)
+            this._thumbnailsSlider.slideIn();
 
         this._updateSpacerVisibility();
     }